package org.lc.platform.mybatis.crud.service;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.IService;
import org.lc.platform.base.dto.PageQuery;
import org.lc.platform.base.vo.PageVo;

import java.util.List;

public interface CrudBaseService<D extends PageQuery, T, V> extends IService<T> {
    V Convertor(T data);

    PageVo<V> getBaseMany(D query);

    V getBaseOne(String id, String join);

    Boolean updateBaseOne(String id, T data);

    Boolean deleteBaseOne(String id);

    Boolean deleteBaseMany(List<String> ids);

    Boolean createBaseOne(T body);

    default <S, VO> VO toVo(S data, Class<VO> cls) {
        return BeanUtil.copyProperties(data, cls);
    }
}
